package com.njbdqn.threetab.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.njbdqn.threetab.domain.Power;
import com.njbdqn.threetab.domain.Userinfos;

public interface PowerDAO {
	@Select("select p.* from power p where exists(select upid from userpows u where u.powid=p.powid and u.userid=#{userid} )")
	public List<Power> findPowerByUserid(int userid);
	
	@Delete("delete from userpows where userid=#{userid}")
	public void deletePower(int userid);
	
	@Select("select * from power")
	public List<Power> findAllPower();
	
	public void saveFetchPower(Userinfos user);
}
